how do you search for how many times a character appears in user input on c sharp

90

how do you search for how many times a character appears in user input on c sharp -

string str = "Techie Delight";
        char ch = 'e';
 
        int freq = str.Count(f => (f == ch));
        Console.WriteLine(freq);

Comments

Submit
0 Comments